package com.vshop.service.impl;

import com.vshop.entity.comentity.PartnerInfo;
import com.vshop.mapper.PartnerInfoMapper;
import com.vshop.service.PartnerInfoService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
/**
 * 企业相关
 * @author lm
 * @date 2020/6/11 15:45
 */
public class PartnerInfoServiceImpl implements PartnerInfoService {
    @Resource
    private PartnerInfoMapper partnerInfoMapper;

    @Override
    @Transactional(rollbackFor = Exception.class)
    public PartnerInfo queryPartnerAccountAndPassword(String partnerCode, String account, String password) {
        return partnerInfoMapper.queryPartnerAccountAndPassword(partnerCode, account, password);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public String getTokenByCode(String partnerCode) {

        return partnerInfoMapper.getTokenByCode(partnerCode);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<PartnerInfo> queryLogoByCode(String partnerCode) {
        return partnerInfoMapper.queryLogoByCode(partnerCode);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public String getSecretByPartnerCode(String partnerCode) {
        return partnerInfoMapper.getSecretByPartnerCode(partnerCode);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public String getPartnerNameByCode(String partnerCode) {
        return partnerInfoMapper.getPartnerNameByCode(partnerCode);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public int findPartnerCodeEixtOrNot(String partnerCode) {
        return partnerInfoMapper.findPartnerCodeEixtOrNot(partnerCode);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void insertPartner(PartnerInfo partner) {

        partnerInfoMapper.insertPartner(partner);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<PartnerInfo> findPartnerCode() {
        return partnerInfoMapper.findPartnerCode();
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public String findSecretByPartnerCode(String partnerCode) {
        return partnerInfoMapper.findSecretByPartnerCode(partnerCode);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public String findPartnerNameBypartnerCode(String partnerCode) {
        return partnerInfoMapper.findPartnerNameBypartnerCode(partnerCode);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public String getPartnerIndex(String partnerCode) {

        return partnerInfoMapper.getPartnerIndex(partnerCode);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<PartnerInfo> findCode() {

        return partnerInfoMapper.findCode();
    }


}
